#include "Battery.h"
#include <iostream>
#include <iomanip>

Battery::Battery() : outputVoltage(0), chargeTime(0) {}

Battery::Battery(const std::string& parameter, double outputVoltage, double chargeTime)
    : parameter(parameter), outputVoltage(outputVoltage), chargeTime(chargeTime) {}

// Getters
std::string Battery::getParameter() const { return parameter; }
double Battery::getOutputVoltage() const { return outputVoltage; }
double Battery::getChargeTime() const { return chargeTime; }

// Setters
void Battery::setParameter(const std::string& parameter) { this->parameter = parameter; }
void Battery::setOutputVoltage(double outputVoltage) { this->outputVoltage = outputVoltage; }
void Battery::setChargeTime(double chargeTime) { this->chargeTime = chargeTime; }

void Battery::display() const {
    std::cout << "电池模块信息:" << std::endl;
    std::cout << "  参数: " << parameter << std::endl;
    std::cout << "  对外供电: " << outputVoltage << "V" << std::endl;
    std::cout << "  充电时长: " << chargeTime << "H" << std::endl;
}